Public Class ThemHangVe
    Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "

    Public Sub New()
        MyBase.New()

        'This call is required by the Windows Form Designer.
        InitializeComponent()

        'Add any initialization after the InitializeComponent() call

    End Sub

    'Form overrides dispose to clean up the component list.
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is Nothing) Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
    Friend WithEvents Label1 As System.Windows.Forms.Label
    Friend WithEvents btnThoat As System.Windows.Forms.Button
    Friend WithEvents btnTaoMoi As System.Windows.Forms.Button
    Friend WithEvents btnThem As System.Windows.Forms.Button
    Friend WithEvents txtTenHangVe As System.Windows.Forms.TextBox
    Friend WithEvents txtMaHangVe As System.Windows.Forms.TextBox
    Friend WithEvents Label3 As System.Windows.Forms.Label
    Friend WithEvents Label2 As System.Windows.Forms.Label
    Friend WithEvents PictureBox1 As System.Windows.Forms.PictureBox
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(ThemHangVe))
        Me.Label1 = New System.Windows.Forms.Label
        Me.btnThoat = New System.Windows.Forms.Button
        Me.btnTaoMoi = New System.Windows.Forms.Button
        Me.btnThem = New System.Windows.Forms.Button
        Me.txtTenHangVe = New System.Windows.Forms.TextBox
        Me.txtMaHangVe = New System.Windows.Forms.TextBox
        Me.Label3 = New System.Windows.Forms.Label
        Me.Label2 = New System.Windows.Forms.Label
        Me.PictureBox1 = New System.Windows.Forms.PictureBox
        CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.SuspendLayout()
        '
        'Label1
        '
        Me.Label1.Font = New System.Drawing.Font("Times New Roman", 18.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(163, Byte))
        Me.Label1.Location = New System.Drawing.Point(112, 16)
        Me.Label1.Name = "Label1"
        Me.Label1.Size = New System.Drawing.Size(272, 48)
        Me.Label1.TabIndex = 0
        Me.Label1.Text = "THÊM HẠNG VÉ"
        Me.Label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
        '
        'btnThoat
        '
        Me.btnThoat.Font = New System.Drawing.Font("Times New Roman", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(163, Byte))
        Me.btnThoat.Location = New System.Drawing.Point(304, 168)
        Me.btnThoat.Name = "btnThoat"
        Me.btnThoat.Size = New System.Drawing.Size(75, 32)
        Me.btnThoat.TabIndex = 4
        Me.btnThoat.Text = "Thoát"
        '
        'btnTaoMoi
        '
        Me.btnTaoMoi.Font = New System.Drawing.Font("Times New Roman", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(163, Byte))
        Me.btnTaoMoi.Location = New System.Drawing.Point(176, 168)
        Me.btnTaoMoi.Name = "btnTaoMoi"
        Me.btnTaoMoi.Size = New System.Drawing.Size(86, 32)
        Me.btnTaoMoi.TabIndex = 3
        Me.btnTaoMoi.Text = "Tạo Mới"
        '
        'btnThem
        '
        Me.btnThem.Font = New System.Drawing.Font("Times New Roman", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(163, Byte))
        Me.btnThem.Location = New System.Drawing.Point(56, 168)
        Me.btnThem.Name = "btnThem"
        Me.btnThem.Size = New System.Drawing.Size(75, 32)
        Me.btnThem.TabIndex = 2
        Me.btnThem.Text = "Thêm"
        '
        'txtTenHangVe
        '
        Me.txtTenHangVe.ForeColor = System.Drawing.Color.Blue
        Me.txtTenHangVe.Location = New System.Drawing.Point(200, 120)
        Me.txtTenHangVe.Name = "txtTenHangVe"
        Me.txtTenHangVe.Size = New System.Drawing.Size(176, 26)
        Me.txtTenHangVe.TabIndex = 1
        '
        'txtMaHangVe
        '
        Me.txtMaHangVe.ForeColor = System.Drawing.Color.Blue
        Me.txtMaHangVe.Location = New System.Drawing.Point(200, 80)
        Me.txtMaHangVe.Name = "txtMaHangVe"
        Me.txtMaHangVe.Size = New System.Drawing.Size(176, 26)
        Me.txtMaHangVe.TabIndex = 0
        '
        'Label3
        '
        Me.Label3.Location = New System.Drawing.Point(56, 120)
        Me.Label3.Name = "Label3"
        Me.Label3.Size = New System.Drawing.Size(96, 23)
        Me.Label3.TabIndex = 9
        Me.Label3.Text = "Tên Hạng Vé"
        '
        'Label2
        '
        Me.Label2.Location = New System.Drawing.Point(56, 80)
        Me.Label2.Name = "Label2"
        Me.Label2.Size = New System.Drawing.Size(96, 23)
        Me.Label2.TabIndex = 8
        Me.Label2.Text = "Mã Hạng Vé"
        '
        'PictureBox1
        '
        Me.PictureBox1.ErrorImage = Nothing
        Me.PictureBox1.Image = CType(resources.GetObject("PictureBox1.Image"), System.Drawing.Image)
        Me.PictureBox1.Location = New System.Drawing.Point(8, 8)
        Me.PictureBox1.Name = "PictureBox1"
        Me.PictureBox1.Size = New System.Drawing.Size(88, 56)
        Me.PictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
        Me.PictureBox1.TabIndex = 30
        Me.PictureBox1.TabStop = False
        '
        'ThemHangVe
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(7, 19)
        Me.BackColor = System.Drawing.Color.FromArgb(CType(CType(192, Byte), Integer), CType(CType(192, Byte), Integer), CType(CType(255, Byte), Integer))
        Me.ClientSize = New System.Drawing.Size(408, 230)
        Me.Controls.Add(Me.PictureBox1)
        Me.Controls.Add(Me.btnThoat)
        Me.Controls.Add(Me.btnTaoMoi)
        Me.Controls.Add(Me.btnThem)
        Me.Controls.Add(Me.txtTenHangVe)
        Me.Controls.Add(Me.txtMaHangVe)
        Me.Controls.Add(Me.Label3)
        Me.Controls.Add(Me.Label2)
        Me.Controls.Add(Me.Label1)
        Me.Font = New System.Drawing.Font("Times New Roman", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.ForeColor = System.Drawing.Color.Blue
        Me.Name = "ThemHangVe"
        Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent
        Me.Text = "Thêm Hạng Vé"
        CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).EndInit()
        Me.ResumeLayout(False)
        Me.PerformLayout()

    End Sub

#End Region

    Private Sub btnThem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnThem.Click
        If txtMaHangVe.Text = "" Then
            MsgBox("Chưa Nhập Mã Hạng Vé !")
            txtMaHangVe.Focus()
            Exit Sub
        End If
        If txtTenHangVe.Text = "" Then
            MsgBox("Chưa Nhập Tên Hạng Vé !")
            Exit Sub
        End If
        Dim hv As New HangVe
        hv.ThemHangVe(txtMaHangVe.Text, txtTenHangVe.Text)
        MessageBox.Show("Đã Thêm 1 Hạng Vé !")
    End Sub

    Private Sub btnTaoMoi_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTaoMoi.Click
        txtMaHangVe.Text = ""
        txtTenHangVe.Text = ""
        txtMaHangVe.Focus()
    End Sub

    Private Sub btnThoat_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnThoat.Click
        Me.Close()
    End Sub
End Class
